package com.xszx.cms.controller;


import com.xszx.cms.entity.Banner;
import com.xszx.cms.service.BannerService;
import com.xszx.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author 白熊
 * @since 2024-07-22
 */
@RestController
@RequestMapping("/cms/bannerfront")
@Api(tags = "网站首页Banner列表")
//@CrossOrigin
public class BannerController {

    @Autowired
    private BannerService bannerService;
    @ApiOperation("查询所有的banner")
    @GetMapping("getAllBanner")
    public R getList(){
        List<Banner> list = bannerService.selectAllBanner();
        return R.ok().data("bannerList",list);
    }
}

